package com.ruoyi.smartcity.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartcity.traffic.mapper.TrafficSignalScheduleMapper;
import com.ruoyi.smartcity.traffic.domain.TrafficSignalSchedule;
import com.ruoyi.smartcity.traffic.service.ITrafficSignalScheduleService;

/**
 * 信号灯调度Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-24
 */
@Service
public class TrafficSignalScheduleServiceImpl implements ITrafficSignalScheduleService 
{
    @Autowired
    private TrafficSignalScheduleMapper trafficSignalScheduleMapper;

    /**
     * 查询信号灯调度
     * 
     * @param id 信号灯调度主键
     * @return 信号灯调度
     */
    @Override
    public TrafficSignalSchedule selectTrafficSignalScheduleById(Long id)
    {
        return trafficSignalScheduleMapper.selectTrafficSignalScheduleById(id);
    }

    /**
     * 查询信号灯调度列表
     * 
     * @param trafficSignalSchedule 信号灯调度
     * @return 信号灯调度
     */
    @Override
    public List<TrafficSignalSchedule> selectTrafficSignalScheduleList(TrafficSignalSchedule trafficSignalSchedule)
    {
        return trafficSignalScheduleMapper.selectTrafficSignalScheduleList(trafficSignalSchedule);
    }

    /**
     * 新增信号灯调度
     * 
     * @param trafficSignalSchedule 信号灯调度
     * @return 结果
     */
    @Override
    public int insertTrafficSignalSchedule(TrafficSignalSchedule trafficSignalSchedule)
    {
        trafficSignalSchedule.setCreateTime(DateUtils.getNowDate());
        return trafficSignalScheduleMapper.insertTrafficSignalSchedule(trafficSignalSchedule);
    }

    /**
     * 修改信号灯调度
     * 
     * @param trafficSignalSchedule 信号灯调度
     * @return 结果
     */
    @Override
    public int updateTrafficSignalSchedule(TrafficSignalSchedule trafficSignalSchedule)
    {
        trafficSignalSchedule.setUpdateTime(DateUtils.getNowDate());
        return trafficSignalScheduleMapper.updateTrafficSignalSchedule(trafficSignalSchedule);
    }

    /**
     * 批量删除信号灯调度
     * 
     * @param ids 需要删除的信号灯调度主键
     * @return 结果
     */
    @Override
    public int deleteTrafficSignalScheduleByIds(Long[] ids)
    {
        return trafficSignalScheduleMapper.deleteTrafficSignalScheduleByIds(ids);
    }

    /**
     * 删除信号灯调度信息
     * 
     * @param id 信号灯调度主键
     * @return 结果
     */
    @Override
    public int deleteTrafficSignalScheduleById(Long id)
    {
        return trafficSignalScheduleMapper.deleteTrafficSignalScheduleById(id);
    }
}
